package tedu.study.day06;

public class MethodTest {
    public static void main(String[] args) {
        //say();
        //sayHi("zhangsan");
        //sayHello("lisi",18);

        double a = getNum();
        System.out.println(a);

        int b = plus(5,6);
        System.out.println(b);

        int m=70,n=80;
        int c = plus(m,n);
        System.out.println(c);

        int[] arr = testArrays(5,10);
        for(int i=0;i<arr.length;i++){
            System.out.println(arr[i]);
        }

    }

    public static double getNum(){
        return 8.888;
    }

    public static int plus(int num1,int num2){
        int num = num1+num2;
        return num;
    }

    public static int[] testArrays(int len,int max){
        int[] arr = new int[len];
        for(int i=0;i<arr.length;i++){
            arr[i] = (int)(Math.random()*(max+1));
        }
        return arr;
    }


    //无返回值
    public static void say(){
        System.out.println("大家好，我叫王五，今年39岁。");
    }

    public static void sayHi(String name){
        System.out.println("大家好，我叫"+name+"，今年39岁。");
    }

    public static void sayHello(String name,int age){
        System.out.println("大家好，我叫"+name+"，今年"+age+"岁。");
    }

}
